import router from '@/router'

const Test = () => import("../components/Test.vue")
const NotFound = () => import("../components/NotFound.vue")

// guardcat
const IndexGuardCat = () => import('../views/guardcat/Index.vue')
const GuardcatHome = () => import('../views/guardcat/home/Home.vue')
const GuardcatLogin = () => import('../views/guardcat/index/Login.vue')
const IndexMonitorTree = () => import('../views/guardcat/machine/IndexMonitorTree.vue')
const IndexMonitorNodes = () => import('../views/guardcat/machine/IndexMonitorNodes.vue')
const IndexJvm = () => import('../views/guardcat/machine/jvm/IndexJvm.vue')
const IndexAppRelation = () => import('../views/guardcat/app/ChartGraphAppRelation.vue')
const IndexMonitorLog = () => import('../views/guardcat/log/IndexMonitorLog.vue')
const IndexSentinel = () => import('../views/guardcat/sentinel/IndexSentinel.vue')
const IndexGw = () => import('../views/guardcat/gateway/IndexGw.vue')
const IndexTracker = () => import('../views/guardcat/trackers/IndexTracker.vue')
const IndexRedis = () => import('../views/guardcat/redis/IndexRedis.vue')
const ApiDoc = () => import('../views/guardcat/app/ApiDoc.vue')

router.addRoute({ path: '/404', component: NotFound, })
router.addRoute({ path: '/:pathMatch(.*)', redirect: '/404', })
router.addRoute({
  path: '/', redirect: '/home'
})

router.addRoute(
  {
    path: '/', name: 'IndexGuardCat', component: IndexGuardCat, meta: { keepAlive: false },
    children: [
      { path: '/indexMonitorTree', name: 'IndexMonitorTree', component: IndexMonitorTree, meta: { keepAlive: false }, },
      { path: '/indexMonitorNodes', name: 'IndexMonitorNodes', component: IndexMonitorNodes, meta: { keepAlive: false }, },
      { path: '/indexJvm', name: 'IndexJvm', component: IndexJvm, meta: { keepAlive: false }, },
      { path: '/indexAppRelation', name: 'IndexAppRelation', component: IndexAppRelation, meta: { keepAlive: false }, },
      { path: '/indexMonitorLog', name: 'IndexMonitorLog', component: IndexMonitorLog, meta: { keepAlive: false }, },
      { path: '/indexSentinel', name: 'IndexSentinel', component: IndexSentinel, meta: { keepAlive: false }, },
      { path: '/indexTracker', name: 'IndexTracker', component: IndexTracker, meta: { keepAlive: false }, },
      { path: '/indexTracker', name: 'IndexTracker', component: IndexTracker, meta: { keepAlive: false }, },
      { path: '/indexRedis', name: 'IndexRedis', component: IndexRedis, meta: { keepAlive: false }, },
      { path: '/indexGw', name: 'IndexGw', component: IndexGw, meta: { keepAlive: false }, },
      { path: '/apiDoc', name: 'ApiDoc', component: ApiDoc, meta: { keepAlive: false }, },
      // { path: '/test', name: 'Test', component: Test, meta: { keepAlive: false } },
      { path: '/home', name: 'Home', component: GuardcatHome, meta: { keepAlive: true } },
    ],
  }
)

router.addRoute(
  {
    path: '/login',
    name: 'Login',
    component: GuardcatLogin,
    meta: {
      keepAlive: false
    }
  }
)